/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.acap.googlemaps.encapsulados;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author Malkavian
 */
@Entity
@Table(name = "iconos")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Iconos.findAll", query = "SELECT i FROM Iconos i"),
    @NamedQuery(name = "Iconos.findByIdiconos", query = "SELECT i FROM Iconos i WHERE i.idiconos = :idiconos")})
public class Iconos implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "idiconos")
    private Integer idiconos;
    @Basic(optional = false)
    @Lob
    @Column(name = "iconos_src")
    private String iconosSrc;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "icono")
    private List<Tipocoordenada> tipocoordenadaList;

    public Iconos() {
    }

    public Iconos(Integer idiconos) {
        this.idiconos = idiconos;
    }

    public Iconos(Integer idiconos, String iconosSrc) {
        this.idiconos = idiconos;
        this.iconosSrc = iconosSrc;
    }

    public Integer getIdiconos() {
        return idiconos;
    }

    public void setIdiconos(Integer idiconos) {
        this.idiconos = idiconos;
    }

    public String getIconosSrc() {
        return iconosSrc;
    }

    public void setIconosSrc(String iconosSrc) {
        this.iconosSrc = iconosSrc;
    }

    @XmlTransient
    public List<Tipocoordenada> getTipocoordenadaList() {
        return tipocoordenadaList;
    }

    public void setTipocoordenadaList(List<Tipocoordenada> tipocoordenadaList) {
        this.tipocoordenadaList = tipocoordenadaList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idiconos != null ? idiconos.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Iconos)) {
            return false;
        }
        Iconos other = (Iconos) object;
        if ((this.idiconos == null && other.idiconos != null) || (this.idiconos != null && !this.idiconos.equals(other.idiconos))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.acap.googlemaps.encapsulados.Iconos[ idiconos=" + idiconos + " ]";
    }
    
}
